import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


const home = r => require.ensure([], () => r(require('@/page/index')), 'home');
const bookshelf = r => require.ensure([], () => r(require('@/page/bookshelf')), 'bookshelf');
const ranking = r => require.ensure([], () => r(require('@/page/ranking')), 'ranking');
const classify = r => require.ensure([], () => r(require('@/page/classify')), 'classify');
const search = r => require.ensure([], () => r(require('@/page/search')), 'search');
const searchbook = r => require.ensure([], () => r(require('@/page/searchbook')), 'searchbook');
const bookdetails = r => require.ensure([], () => r(require('@/page/bookdetails')), 'bookdetails');
const recommend = r => require.ensure([], () => r(require('@/page/recommend')), 'recommend');
const readbook = r => require.ensure([], () => r(require('@/page/readbook')), 'readbook');
const problem = r => require.ensure([], () => r(require('@/page/problem')), 'problem');
const answer = r => require.ensure([], () => r(require('@/page/answer')), 'answer');
const feedback = r => require.ensure([], () => r(require('@/page/feedback')), 'feedback');
const protocol = r => require.ensure([], () => r(require('@/page/protocol')), 'protocol');
const typeBook = r => require.ensure([], () => r(require('@/page/typeBook')), 'typeBook');
const totalRanking = r => require.ensure([], () => r(require('@/page/totalRanking')), 'totalRanking');
const featured = r => require.ensure([], () => r(require('@/page/featured')), 'featured');
const bookCache = r => require.ensure([], () => r(require('@/page/bookCache')), 'bookCache');
const pushSetting = r => require.ensure([], () => r(require('@/page/pushSetting')), 'pushSetting');

const selectGender = r => require.ensure([], () => r(require('@/page/selectGender')), 'selectGender');



export default new Router({
  // mode:'history',
  routes: [
	  {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/bookshelf',
      name: 'bookshelf',
      component: bookshelf
    },
    {
      path: '/ranking',
      name: 'ranking',
      component: ranking
    },
    {
      path: '/classify/:id',
      name: 'classify',
      component: classify
    },
    {
      path: '/searchbook',
      name: 'searchbook',
      component: searchbook
    },
    {
      path: '/search',
      name: 'search',
      component: search
    },
    {
      path: '/bookdetails/:id',
      name: 'bookdetails',
      component: bookdetails
    },
    {
      path: '/recommend',
      name: 'recommend',
      component: recommend
    },
    {
      path: '/readbook/:id',
      name: 'readbook',
      component: readbook
    },
    {
      path: '/problem',
      name: 'problem',
      component: problem
    },
    {
      path: '/answer/:id',
      name: 'answer',
      component: answer
    },
    {
      path: '/feedback',
      name: 'feedback',
      component: feedback
    },
    {
      path: '/protocol',
      name: 'protocol',
      component: protocol
    },
    {
      path: '/typeBook/:id',
      name: 'typeBook',
      component: typeBook
    },
    {
      path: '/totalRanking/:id',
      name: 'totalRanking',
      component: totalRanking
    },
    {
      path: '/featured',
      name: 'featured',
      component: featured
    },
    {
      path: '/bookCache',
      name: 'bookCache',
      component: bookCache
    },
    {
      path: '/pushSetting',
      name: 'pushSetting',
      component: pushSetting
    },
    {
      path: '/selectGender',
      name: 'selectGender',
      component: selectGender
    },

      
    
  ]
})
